<template>
	<svg class="svg-icon" :width="iconSize" :height="iconSize" aria-hidden="true" v-on="$listeners">
		<use :xlink:href="iconSvg" />
	</svg>
</template>

<script>
export default {
	name: 'svgIcon',
	props: {
		iconName: { type: String, required: true },
		size: { type: [String, Number], default: 24 }
	},
	computed: {
		iconSvg() {
			return `#icon-${this.iconName}`;
		},
		iconSize() {
			return Number(this.size);
		}
	}
};
</script>

<style scoped>
/*此处为所有图标默认显示样式*/
</style>
